package com.aiowang.springboot.single.activemq.utils;

import com.aiowang.springboot.single.activemq.config.CustomProperties;
import org.apache.activemq.ActiveMQConnectionFactory;

public class ToolsUtils {


    public static ActiveMQConnectionFactory getActiveMQConnectionFactory(
            CustomProperties customProperties) {
        String brokerUrl = customProperties.getBrokerUrl();
        String username = customProperties.getUser();
        String password = customProperties.getPassword();
        String clientIDPrefix = customProperties.getClientIDPrefix();
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory();
        factory.setBrokerURL(brokerUrl);
        factory.setUserName(username);
        factory.setPassword(password);
        factory.setClientIDPrefix(clientIDPrefix);
        return factory;

    }


}
